/*
 * @Author: czy
 * @Date: 2021-05-21 14:28:30
 * @LastEditTime: 2021-05-21 21:48:54
 */
#include "dev/hardware/uart.h"
#include "dev/hardware/vga.h"

/**
 * @description: Put a character from the input device.
 * @param ch    Character.
 * @param fd    Equipment number, -1 for uart, 1 for vga, 0 for uart and vga.
 * @return Character.
 */
int putc(int ch, int fd)
{
    if (fd <= 0)
    {
        uart_put_char(ch);
    }
    if (fd >= 0)
    {
        vga_put_char(ch);
    }
    return ch;
}